<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>GitHub+docsify搭建个人博客 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="GitHub+docsify搭建个人博客docsify环境搭建 环境  Git GitHub账号 Node.js   安装docsify terminal输入：npm install docsify-cli -g  开始搭建  选择桌面目录, 作为站点目录, 然后在Terminal中cd到这个目录, 执行 docsify init .&#x2F;docs  查看生成文件(docs文件夹)  index.ht">
<meta property="og:type" content="article">
<meta property="og:title" content="GitHub+docsify搭建个人博客">
<meta property="og:url" content="https://lummer.gitee.io/hexo/2021/07/10/GitHub+docsify%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="GitHub+docsify搭建个人博客docsify环境搭建 环境  Git GitHub账号 Node.js   安装docsify terminal输入：npm install docsify-cli -g  开始搭建  选择桌面目录, 作为站点目录, 然后在Terminal中cd到这个目录, 执行 docsify init .&#x2F;docs  查看生成文件(docs文件夹)  index.ht">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2021-07-10T05:57:47.593Z">
<meta property="article:modified_time" content="2021-09-20T10:11:33.831Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/hexo/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/hexo/css/style.css">

<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/hexo/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/hexo/">Home</a>
        
          <a class="main-nav-link" href="/hexo/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/hexo/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://lummer.gitee.io/hexo"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-GitHub+docsify搭建个人博客" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/hexo/2021/07/10/GitHub+docsify%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time datetime="2021-07-10T05:57:47.593Z" itemprop="datePublished">2021-07-10</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      GitHub+docsify搭建个人博客
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="GitHub-docsify搭建个人博客"><a href="#GitHub-docsify搭建个人博客" class="headerlink" title="GitHub+docsify搭建个人博客"></a>GitHub+docsify搭建个人博客</h2><h3 id="docsify环境搭建"><a href="#docsify环境搭建" class="headerlink" title="docsify环境搭建"></a>docsify环境搭建</h3><ol>
<li><p>环境</p>
<ul>
<li><code>Git</code></li>
<li><code>GitHub</code>账号</li>
<li><code>Node.js</code></li>
</ul>
</li>
<li><p>安装<code>docsify</code><br> <code>terminal</code>输入：<code>npm install docsify-cli -g</code></p>
</li>
<li><p>开始搭建</p>
<p> 选择桌面目录, 作为站点目录, 然后在<code>Terminal</code>中<code>cd</code>到这个目录, 执行<code> docsify init ./docs</code></p>
</li>
<li><p>查看生成文件(<code>docs</code>文件夹)</p>
<ul>
<li><code>index.html</code>入口文件</li>
<li><code>README.md</code>主页内容</li>
<li><code>.nojekll</code>阻止<code>Github Pages</code>忽略下划线开头的文件</li>
</ul>
</li>
<li><p>启动<br> <code>Terminal</code>中键入<code>docsify serve docs</code></p>
</li>
<li><p>浏览器访问<code>localhost:3000</code></p>
</li>
<li><p>搭建完成</p>
</li>
</ol>
<h3 id="美化"><a href="#美化" class="headerlink" title="美化"></a>美化</h3><ol>
<li><p>侧边栏<br> 先新建一个<code>_loadSidebar.md</code>文件(开头要有下划线)，可以这样写：</p>
 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">- 一个题目</span><br><span class="line">	- [还是题目，可以加链接](Blogs\乱搞.md)</span><br><span class="line">	- [另外一个题目](Blogs\还是乱搞.md)</span><br></pre></td></tr></table></figure></li>
<li><p>修改<code>index.html</code>文件</p>
<p> 在里面的js脚本中添加一行：<code>loadSidebar: true</code></p>
<p> 我们再打开<code>localhost:3000</code>, 查看内容</p>
</li>
<li><p>封面</p>
<p> 先新建<code>_coverpage.md</code>文件, 输入以下内容</p>
 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># MyBlogs</span><br><span class="line"></span><br><span class="line">&gt; 后退！我要装逼了！</span><br><span class="line">[一个沙雕的个人博客,点这里访问我的GitHub](github.com/A1walker)</span><br><span class="line">[点这里访问GitHUb项目地址](</span><br></pre></td></tr></table></figure></li>
<li><p>修改<code>index.html</code>文件</p>
<p> 在里面的<code>js</code>脚本中添加一行：<code>coverpage: true</code></p>
<p> 我们再打开<code>localhost:3000</code>, 查看内容</p>
</li>
</ol>
<h3 id="Github-Pages"><a href="#Github-Pages" class="headerlink" title="Github Pages"></a>Github Pages</h3><ol>
<li><p>创建仓库,</p>
<ul>
<li>命名为<code>docs</code></li>
<li>直接点击<code>Create New repository</code></li>
</ul>
</li>
<li><p>本地导入</p>
<ul>
<li><p>打开<code>Terminal</code>, <code>cd</code>到<code>docs</code>文件夹下</p>
</li>
<li><p>依次输入以下命令</p>
  <figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git init   #初始化一个仓库</span><br><span class="line">git add -A   #添加所有文件到暂存区（先交给git管着）</span><br><span class="line">git commit -m &quot;fuck&quot;  #提交到git仓库，-m后面是注释</span><br><span class="line">git remote add origin https://github.com/Lummer-Li/docs.git  #网址要根据情况变化</span><br><span class="line">git push -u origin master  #推送到远程docs仓库</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li><p><code>GitHub Settings</code></p>
<ul>
<li><code>GitHub Pages</code></li>
<li><code>Source</code>下面选择<code>master branch/root folder(如果是以文件夹的形式放进去的, 选择 /docs)</code></li>
<li>完成</li>
</ul>
</li>
<li><p>访问</p>
</li>
</ol>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://lummer.gitee.io/hexo/2021/07/10/GitHub+docsify%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" data-id="cktshq59w0000du9lg7ub0ug0" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/hexo/2021/07/11/Github%E5%9B%BD%E5%86%85%E9%95%9C%E5%83%8F%E7%BD%91%E7%AB%99%EF%BC%8C%E8%A7%A3%E5%86%B3Github%E8%AE%BF%E9%97%AE%E7%9A%84%E7%A5%9E%E5%99%A8/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Github国内镜像网站，解决Github访问的神器
        
      </div>
    </a>
  
  
    <a href="/hexo/2021/03/03/Linux/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Linux</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/09/">September 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/08/">August 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/07/">July 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/03/">March 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/02/">February 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/01/">January 2021</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/hexo/2021/09/15/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/hexo/2021/08/20/Mac%20%E5%85%A8%E5%B1%8F%E6%97%B6%E8%87%AA%E5%8A%A8%E9%9A%90%E8%97%8F%E7%A8%8B%E5%BA%8F%E5%9D%9E/">Mac 全屏时自动隐藏程序坞</a>
          </li>
        
          <li>
            <a href="/hexo/2021/07/29/Mac%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84.DS_Store/">Mac系统中的.DS_Store</a>
          </li>
        
          <li>
            <a href="/hexo/2021/07/21/Markdown/">Markdown</a>
          </li>
        
          <li>
            <a href="/hexo/2021/07/11/Github%E5%9B%BD%E5%86%85%E9%95%9C%E5%83%8F%E7%BD%91%E7%AB%99%EF%BC%8C%E8%A7%A3%E5%86%B3Github%E8%AE%BF%E9%97%AE%E7%9A%84%E7%A5%9E%E5%99%A8/">Github国内镜像网站，解决Github访问的神器</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2021 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/hexo/" class="mobile-nav-link">Home</a>
  
    <a href="/hexo/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/hexo/fancybox/jquery.fancybox.css">

  
<script src="/hexo/fancybox/jquery.fancybox.pack.js"></script>




<script src="/hexo/js/script.js"></script>




  </div>
</body>
</html>